import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect:'/home'
    },
    {
      path: '/home',
      name: 'home',
      component: HomeView
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue')
    },
    {
      path: '/vue3-test',
      component: () => import('../views/Vue3TestView.vue'),
      meta: {
        title: 'svg图标的使用'
      },
    },
    {
      path: '/:pathMatch(.*)',
      name: 'error-404',
      meta: {
        title: '404',
        noToken: true
      },
      component: () => import('../../vue3-test/src/view/NotFound/index.vue')
    }
  ]
})

export default router
